package thread;

/**
 * 线程优先级
 */
public class PriorityDemo {
    public static void main(String[] args) {
        Thread max = new Thread(){
            public void run(){
                for (int i = 0; i < 100; i++) {
                    System.out.println("max");
                }
            }
        };
        Thread norm = new Thread(){
            public void run(){
                for (int i = 0; i < 100; i++) {
                    System.out.println("norm");
                }
            }
        };
        Thread min = new Thread() {
            @Override
            public void run() {
                for (int i = 0; i < 100; i++) {
                    System.out.println("min");
                }
            }
        };
        max.setPriority(10);
        min.setPriority(1);

        max.start();
        norm.start();
        min.start();
    }
}
